package utils;

public class Page {
    private int currentPage;
    private int totalPage;
    private int totalCount;
    private int pageSize = 10; // 默认每页显示10条记录

    public void setTotalPage() {
        if (totalCount == 0) {
            this.totalPage = 0;
        } else {
            this.totalPage = (totalCount + pageSize - 1) / pageSize;
        }
    }

    // Getters and Setters
    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }
}
